package com.kaigejava.kgblog.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kaigejava.kgblog.dao.auto.TblActionMapper;
import com.kaigejava.kgblog.model.auto.TblAction;
import com.kaigejava.kgblog.model.auto.TblActionExample;
import com.kaigejava.kgblog.service.ITblActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by sizhongkai on 2018/7/26.
 */
@Service(value="actionService")
public class TblActionServiceImpl implements ITblActionService {
    @Autowired
    private TblActionMapper tblActionMapper;

    @Override
    public PageInfo<TblAction> findAll(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        TblActionExample example = new  TblActionExample();
        List<TblAction> list = tblActionMapper.selectByExample(example);
        PageInfo result = new PageInfo(list);
        return result;
    }
}
